package com.itlong.cloud.app.dao;

import com.itlong.cloud.POJO.PO.PropertyParkCouponPO;
import com.itlong.cloud.POJO.VO.app.AppGetCouponListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      优惠券相关持久层接口
 * <desc/>
 *
 * @createDate 2018/11/08
 */
@Mapper
@Repository
public interface IAppCouponDao {

    /**
     * <desc>
     *      获取优惠券列表
     * </desc>
     *
     * @return 优惠券列表
     * @author wanghzi
     * @createDate 2018/11/09
     */
    List<AppGetCouponListVO> getCouponList(@Param("phoneNo") String phoneNo, @Param("projectId") String projectId, @Param("redeemCode") String redeemCode, @Param("type") String type);

    /**
     * <desc>
     *      获取优惠券信息 By 兑换码
     * </desc>
     *
     * @return 优惠券信息
     * @author wanghzi
     * @createDate 2018/11/09
     */
    PropertyParkCouponPO getCouponByRedeemCode(@Param("redeemCode") String redeemCode);

    /**
     * <desc>
     *      添加(兑换)优惠券
     * </desc>
     *
     * @return 添加的优惠券
     * @author wanghzi
     * @createDate 2018/11/09
     */
    Integer update(Map<String, Object> map);

    /**
     * <desc>
     *      获取优惠券
     * </desc>
     *
     * @return 优惠券
     * @author wanghzi
     * @createDate 2018/11/09
     */
    AppGetCouponListVO getCouponByCouponId(@Param("parkCouponId") String parkCouponId);
}
